import type { IssuingInvoicesHistoryItem } from '@/types/api'

interface FetchIssuingInvoicesHistoryListAPIResData {
  code: number
  msg: string
  time: string
  data: {
    total: number
    per_page: string
    current_page: number
    last_page: number
    data: IssuingInvoicesHistoryItem[]
  }
}

interface FetchIssuingInvoicesHistoryListAPIParams {
  order_type: string // 1 城际 2 普通
  page: string
  limit: string
}

export function fetchIssuingInvoicesHistoryListAPI(params: FetchIssuingInvoicesHistoryListAPIParams, token: string) {
  return httpInstance.get<FetchIssuingInvoicesHistoryListAPIResData, FetchIssuingInvoicesHistoryListAPIParams>(
    '/api/order/invoiceorderhistorylist',
    { params, headers: { token } },
  )
}
